import plotly_express as px
import plotly.graph_objects as go

# 1.内置数据查看
df = px.data.iris()
print(df.head())

# 指定颜色：字符型数据 映射到颜色
fig = px.scatter(
    df,
    x="sepal_width",
    y="sepal_length",
    color = "species",
)
fig.show()

# 数值大小 映射到颜色
fig2 = px.scatter(
    df,
    x="sepal_width",
    y="sepal_length",
    color = "sepal_length",
)
fig2.show()